INCLUDE_DIRECTORIES(${ROSS_BINARY_DIR})
IF(USE_DAMARIS)
    INCLUDE_DIRECTORIES(${DAMARIS_INCLUDE}) 
ENDIF(USE_DAMARIS)
IF(BGPM)
	INCLUDE_DIRECTORIES(${ROSS_SOURCE_DIR} ${BGPM_LIB})
ELSE(NOT(BGPM))
	INCLUDE_DIRECTORIES(${ROSS_SOURCE_DIR})
ENDIF(BGPM)

SET(phold_srcs
phold.c		phold.h)


ADD_EXECUTABLE(phold ${phold_srcs})
ADD_EXECUTABLE(phold_test ${phold_srcs})

IF(BGPM)
	TARGET_LINK_LIBRARIES(phold ROSS imp_bgpm m)
	TARGET_LINK_LIBRARIES(phold_test ROSS imp_bgpm m)
ELSE(NOT(BGPM))
    IF(USE_DAMARIS)
        TARGET_LINK_LIBRARIES(phold ROSS ROSS_Damaris m)
        TARGET_LINK_LIBRARIES(phold_test ROSS ROSS_Damaris m)
    ELSE(NOT(USE_DAMARIS))
        TARGET_LINK_LIBRARIES(phold ROSS m)
        TARGET_LINK_LIBRARIES(phold_test ROSS m)
    ENDIF(USE_DAMARIS)
ENDIF(BGPM)

ROSS_TEST_SCHEDULERS(phold)
ROSS_TEST_INSTRUMENTATION(phold)

SET_TARGET_PROPERTIES(phold_test PROPERTIES COMPILE_DEFINITIONS TEST_COMM_ROSS)
ROSS_TEST_SCHEDULERS(phold_test)
ROSS_TEST_INSTRUMENTATION(phold_test)

INSTALL(FILES ${ROSS_BINARY_DIR}/../models/phold/phold DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
